<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<script type="text/javascript">
			window.onload = function(){
				var title = document.getElementById("title");
				var btn = document.getElementById("btn");
				btn.onclick = function(){
					//设置标签内容 并且可以解析html标签
//					title.innerHTML = "<h1>哈哈哈哈</h1>";
					
					//获取标签内所有的内容包括标签
//					var content = title.innerHTML;
//					alert(content);

					//设置标签内容 但是不解析html标签
//					title.textContent = "<h1>哈哈哈哈</h1>";

					//获取标签文本内容
					var content = title.textContent;
					alert(content);
				}
			}
		</script>
	</head>
	<body>
		<button id="btn">我是按钮</button>
		<a href="" id="title"><h1>我是a标签当中的h1标签</h1></a>
	</body>
</html>
